<?php

#基础函数
include_once('_path.php');
include_once("../includes/init.php");

$user_ids = $_REQUEST['user_ids'];

#如果user_ids是
if(!is_array($user_ids)){
	$user_ids = array();
	$user_ids[0] = $_REQUEST['user_id'];
}

	if(sizeof($user_ids)){
		foreach ($user_ids as $user_id) {
			//$quote['user_id'] = $database->quote($user_id);
			if(is_numeric($user_id)){
				switch ($_REQUEST['type']) {
					case 'lock':
							$database->execute("UPDATE user SET status = 1 WHERE id = ".$user_id.";");
							add_log('do_lock', 'user', "lock user id is $user_id");
						break;
					case 'unlock':
						$database->execute("UPDATE user SET status = 0 WHERE id = ".$user_id.";");
							add_log('do_unlock', 'user', "unlock user id is $user_id");
						break;
				}
			}
		}
	}

$_REQUEST['referrer'] = "./";
redirect("Updated");
?>